package com.bdzl.biz.service.impl;

import com.bdzl.biz.dao.AgentRelBankcardDao;
import com.bdzl.biz.service.AgentRelBankcardService;
import com.bdzl.pub.entity.loan.AgentRelBankcardDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class AgentRelBankcardServiceImpl implements AgentRelBankcardService {
	@Autowired
	private AgentRelBankcardDao agentRelBankcardDao;

	@Override
	public AgentRelBankcardDO get(Integer arbId){
		return agentRelBankcardDao.get(arbId);
	}

	@Override
	public List<AgentRelBankcardDO> list(Map<String, Object> map){
		return agentRelBankcardDao.list(map);
	}

	@Override
	public int count(Map<String, Object> map){
		return agentRelBankcardDao.count(map);
	}

	@Override
	public int save(AgentRelBankcardDO agentRelBankcard){
		return agentRelBankcardDao.save(agentRelBankcard);
	}

	@Override
	public int update(AgentRelBankcardDO agentRelBankcard){
		return agentRelBankcardDao.update(agentRelBankcard);
	}

	@Override
	public int remove(Integer arbId){
		return agentRelBankcardDao.remove(arbId);
	}

	@Override
	public int batchRemove(Integer[] arbIds){
		return agentRelBankcardDao.batchRemove(arbIds);
	}

	@Override
	public String arbFlagUtil(String arbFlag) {
		String[] array = arbFlag.split(",");
		String strArr = "";
		for (String str :array) {
			if("carpay".equals(str)){
				strArr = strArr+",车款";
			}else if("comm".equals(str)){
				strArr = strArr+",佣金";
			}else if("rebate".equals(str)){
				strArr = strArr+",回扣，奖金";
			}else if("mortgage".equals(str)){
				strArr = strArr+",抵押费";
			}
		}
		if(strArr!=null&&strArr!=""){
			if(strArr.length()>1){
				strArr = strArr.substring(1,strArr.length()-1);
			}
		}
		return strArr;
	}
}
